package com.duqc.common.spi;

import java.sql.*;
import java.util.Properties;
import java.util.logging.Logger;

/**
 * @ClassName JDBCDemo
 * @Description JDBCDemo
 * @Author duqc
 * @Date 2023/3/20
 **/
public class JDBCDemo implements Driver {

    static {
        try {
            java.sql.DriverManager.registerDriver(new JDBCDemo());
        } catch (SQLException e) {
            throw new RuntimeException("Can't register driver!");
        }
    }

    @Override
    public Connection connect(String url, Properties info) throws SQLException {
        return null;
    }

    @Override
    public boolean acceptsURL(String url) throws SQLException {
        return false;
    }

    @Override
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
        return new DriverPropertyInfo[0];
    }

    @Override
    public int getMajorVersion() {
        return 0;
    }

    @Override
    public int getMinorVersion() {
        return 0;
    }

    @Override
    public boolean jdbcCompliant() {
        return false;
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return null;
    }

    public JDBCDemo() throws SQLException {
        // Required for Class.forName().newInstance()
    }
}
